import { Button } from "antd";
// import tcb from "tcb-js-sdk";
import cloudbase from "@cloudbase/js-sdk";

const app = cloudbase.init({
    env: "cloudserver-3gqjdbsqbd38f519",
    region: "ap-guangzhou"
});
// const auth = app.auth();

function Home() {
    const download = () => {
        // auth.anonymousAuthProvider().signIn()   // 匿名登录，实际业务时根据需要进行调整
        //     .then(() => {
        //         console.log("登陆成功") //登录成功
        //     }).catch(err => {
        //         console.log("登录失败", err) //登录失败
        //     })
        app
            .downloadFile({
                fileID: "cloud://cloudserver-3gqjdbsqbd38f519.636c-cloudserver-3gqjdbsqbd38f519-1313242783/5_app-debug.apk"
            })
            .then((res) => {

            });
        // const link = document.createElement("a");
        // link.href = "";
        // link.display = "none";
        // link.click();

    }

    return (
        <div>
            <Button type="primary" onClick={download}>download</Button>
        </div>
    )
}

export default Home;